#!/usr/bin/env python3

import os
import json
import requests
li = lambda x : print('\x1b[01;38;5;214m' + x + '\x1b[0m')

flag_file = './flags'
header = {
    'Cookie': 'none'
}

def submit():
    with open(flag_file) as flag_txt:
        flags = flag_txt.readlines()
        host = '20.21.7.1'
        for flag in flags:
            flag = flag.strip()
            url = 'http://20.21.7.1/match-open-api/api/v1/player/awd/auto-submit?exerciseId=168&token=USR-20210716-vwQ3b&flag='
            url += flag
            print(url)
            try:
                res = requests.get(url,headers=header,timeout=2)
                li(res.text)
            except:
                li('connect fail!')
                continue
submit()
